home *** CD-ROM | disk | FTP | other *** search
/ EuroCD 3 / EuroCD 3.iso / Programming / AMarquee / PCQ / AMarquee.i next >
Text File  |  1998-06-24  |  7KB  |  141 lines

  1. { AMarquee.i for PCQ Pascal }
  2. { Translated from file AMarquee.h }
  3. { by Jeremy Friesner }
  4.  
  5. {$I "Include:Exec/Ports.i"}
  6.  
  7. type 
  8.  
  9. {***** QMessage ***************************************************}
  10.  
  11.   QMessage = record
  12.   qm_Msg : Message;       { Don't directly use the contents of qm_Msg! }
  13.   qm_ID  : Integer;       { Message ID # of transaction related to this opCode, or -1 if no ID is applicable. }
  14.   qm_Status : Integer;    { One of the QERROR_* codes defined in AMarquee headers. }
  15.   qm_Path : String;       { Pathname of a node, or NULL if not applicable. }
  16.   qm_Data : Address;      { Pointer to beginning of data buffer, or NULL if not applicable. }
  17.   qm_DataLen : Integer;   { Length of qm_Data buffer, or 0 if not applicable. }
  18.   qm_ActualLen : Integer; { Length of the data buffer stored on the AMarquee server. }
  19.   qm_ErrorLine : Integer; { Line # of the server source code that generated the error.  Useful for debugging. }
  20.   qm_Private : Address;   { Private info used by FreeQMessage() }
  21.   end;
  22.   QMessagePtr = ^QMessage;
  23.   
  24. {***** QSession ***************************************************}
  25.  
  26.   QSession = record
  27.   qMsgPort : MsgPortPtr;  { Wait() on this for QMessages! }
  28.   {******************************************************************}
  29.   { Invisible, private info is here... don't trust sizeof(QSession)! }
  30.   {******************************************************************}
  31.   end;
  32.   QSessionPtr = ^QSession;
  33.  
  34. {***** QRunInfo ***************************************************}
  35.  
  36.   QRunInfo = record
  37.   qr_Allowed : Integer; { The theoretical maximum number of bytes your server may allocate. }
  38.   qr_Alloced : Integer; { The number of bytes currently allocated by your server. }
  39.   qr_Avail   : Integer; { The number of bytes that may actually be allocated by your server. }
  40.   qr_CurrentPrivs  : Integer; { The bit-chord of QPRIV_* privileges that your client has. }
  41.   qr_PossiblePrivs : Integer; { The bit-chord of QPRIV_* privileges that your client could get if it asked for them. }
  42.   end;
  43.   QRunInfoPtr = ^QRunInfo;
  44.  
  45. { Different error types that can be returned to the client in QMessages }
  46. const
  47.     QERROR_NO_ERROR        =  0; { Everything is okay }
  48.     QERROR_UNKNOWN         = -1; { Don't know what the error was. }
  49.     QERROR_MALFORMED_KEY   = -2; { Keystring could not be parsed or "dir" does not exist }
  50.     QERROR_NO_SERVER_MEM   = -3; { Server did not have enough mem available to complete request }
  51.     QERROR_NO_CONNECTION   = -4; { The connection to the server went south }
  52.     QERROR_UNPRIVILEGED    = -5; { You're not allowed to do that! }
  53.     QERROR_UNIMPLEMENTED   = -6; { Feature you requested does not exist yet }
  54.     QERROR_NO_CLIENT_MEM   = -7; { Your computer didn't have enough memory available to complete an action }
  55.     QERROR_SYS_MESSAGE     = -8; { This message is a text message from the sysadmin on the server }
  56.  
  57. { These error types may be returned by QFreeSession() after a QSession }
  58. {   allocation attempt fails. }
  59.     QERROR_NO_TCP_STACK    = -20; { TCP stack wasn't running }
  60.     QERROR_HOSTNAME_LOOKUP = -21; { Hostname lookup of server failed }
  61.     QERROR_ABORTED         = -22; { TCP thread got a control-C }
  62.     QERROR_NO_SERVER       = -23; { No AMarquee server at requested host/port }
  63.     QERROR_NO_INETD        = -24; { The program wasn't launched by inetd }
  64.     QERROR_ACCESS_DENIED   = -25; { The server wouldn't accept our connection }
  65.  
  66. { Flags representing special privileges; used with QRequestPrivileges(), etc }
  67.     QPRIV_KILLCLIENTS       = $1; { Can forcible disconnect other clients }
  68.     QPRIV_ADMIN             = $2; { Can change ENV variables on server }
  69.     QPRIV_GETSYSMESSAGES    = $4; { Can receive system messages }
  70.     QPRIV_SENDSYSMESSAGES   = $8; { Can send system messages }
  71.         
  72.     QPRIV_ALL               = $F; { all QPRIV_* bits or'd together }
  73.  
  74. { Flags to use with QGo() }
  75.     QGOF_SYNC               = $1;   { Send a sync packet when all has settled }
  76.  
  77.  
  78. { Function prototypes }
  79. { Translated from file AMarquee_protos.h }
  80. { by Jeremy Friesner }
  81.  
  82. Function QNewSession(hostname : String; port : Integer; progname : String) : QSessionPtr;
  83.     External;
  84. Function QNewSessionAsync(hostname : String; port : Integer; progname : String) : QSessionPtr;
  85.     External;
  86. Function QFreeSession(session : QSessionPtr) : Integer;
  87.     External;
  88. Function QDebugOp(session : QSessionPtr; string : String) : Integer;
  89.     External;
  90. Function QGetOp(session : QSessionPtr; wildpath : String; maxBytes : Integer) : Integer;
  91.     External;
  92. Function QDeleteOp(session : QSessionPtr; wildpath : String) : Integer;
  93.     External;
  94. Function QRenameOp(session : QSessionPtr; path : String; newname : String) : Integer;
  95.     External;
  96. Function QSubscribeOp(session : QSessionPtr; wildpath : String; maxBytes : Integer) : Integer;
  97.     External;
  98. Function QSetOp(session : QSessionPtr; path : String; buffer : Address; bufferLength : Integer) : Integer;
  99.     External;
  100. Function QClearSubscriptionsOp(session : QSessionPtr; which : Integer) : Integer;
  101.     External;
  102. Function QPingOp(session : QSessionPtr) : Integer;
  103.     External;
  104. Function QInfoOp(session : QSessionPtr) : Integer;
  105.     External;
  106. Function QSetAccessOp(session : QSessionPtr; newAccess : String) : Integer;
  107.     External;
  108. Function QGo(session : QSessionPtr; flags : Integer) : Integer;
  109.     External;
  110. Procedure FreeQMessage(session : QSessionPtr; qmsg : QMessagePtr);
  111.     External;
  112. Function QNewHostSession(hostnames : String; port : ^Integer; progNames : String) : QSessionPtr;
  113.     External;
  114. Function QStreamOp(session : QSessionPtr; path : String; buffer : Address; bufferLenggth : Integer) : Integer;
  115.     External;
  116. Function QNewServerSession(hostNames : String; progNames : String) : QSessionPtr;
  117.     External;
  118. Function QSetMessageAccessOp(session : QSessionPtr; newAccess : String; maxBytes : Integer) : Integer;
  119.     External;
  120. Function QMessageOp(session : QSessionPtr; hosts : String; buffer : Address; bufferLength : Integer) : Integer;
  121.     External;
  122. Function QNumQueuedPackets(session : QSessionPtr) : Integer;
  123.     External;
  124. Function QNumQueuedBytes(session : QSessionPtr) : Integer;
  125.     External;
  126. Function QErrorName(error : Integer) : String;
  127.     External;
  128. Function QRequestPrivilegesOp(session : QSessionPtr; privBits : Integer) : Integer;
  129.     External;
  130. Function QReleasePrivilegesOp(session : QSessionPtr; privBits : Integer) : Integer;
  131.     External;
  132. Function QKillClientsOp(session : QSessionPtr; hosts : String) : Integer;
  133.     External;
  134. Function QSetParameterOp(session : QSessionPtr; paramName : String; newValue : String) : Integer;
  135.     External;
  136. Function QGetParameterOp(session : QSessionPtr; paramName : String) : Integer;
  137.     External;
  138. Function QSysMessageOp(session : QSessionPtr; hosts : String; message : String) : Integer;
  139.     External;
  140. Function QGetAndSubscribeOp(session : QSessionPtr; path : String; buffer : Address; bufferLength : Integer) : Integer;
  141.     External;